import 'dart:convert' show json;

class GodEpisode {
  int code;
  String msg;
  List<Godsode> data;

  GodEpisode.fromParams({this.code, this.msg, this.data});

  factory GodEpisode(jsonStr) => jsonStr == null
      ? null
      : jsonStr is String
          ? new GodEpisode.fromJson(json.decode(jsonStr))
          : new GodEpisode.fromJson(jsonStr);

  GodEpisode.fromJson(jsonRes) {
    code = jsonRes['code'];
    msg = jsonRes['msg'];
    data = jsonRes['data'] == null ? null : [];

    for (var dataItem in data == null ? [] : jsonRes['data']) {
      data.add(dataItem == null ? null : new Godsode.fromJson(dataItem));
    }
  }

  @override
  String toString() {
    return '{"code": $code,"msg": ${msg != null ? '${json.encode(msg)}' : 'null'},"data": $data}';
  }
}

class Godsode {
  String gif;
  String image;
  String top_commentsVoiceuri;
  int comment;
  int down;
  int forward;
  int soureid;
  int up;
  String header;
  String passtime;
  String text;
  String thumbnail;
  String top_commentsContent;
  String top_commentsHeader;
  String top_commentsName;
  String type;
  String uid;
  String username;
  String video;

  Godsode.fromParams(
      {this.gif,
      this.image,
      this.top_commentsVoiceuri,
      this.comment,
      this.down,
      this.forward,
      this.soureid,
      this.up,
      this.header,
      this.passtime,
      this.text,
      this.thumbnail,
      this.top_commentsContent,
      this.top_commentsHeader,
      this.top_commentsName,
      this.type,
      this.uid,
      this.username,
      this.video});

  Godsode.fromJson(jsonRes) {
    gif = jsonRes['gif'];
    image = jsonRes['image'];
    top_commentsVoiceuri = jsonRes['top_commentsVoiceuri'];
    comment = jsonRes['comment'];
    down = jsonRes['down'];
    forward = jsonRes['forward'];
    soureid = jsonRes['soureid'];
    up = jsonRes['up'];
    header = jsonRes['header'];
    passtime = jsonRes['passtime'];
    text = jsonRes['text'];
    thumbnail = jsonRes['thumbnail'];
    top_commentsContent = jsonRes['top_commentsContent'];
    top_commentsHeader = jsonRes['top_commentsHeader'];
    top_commentsName = jsonRes['top_commentsName'];
    type = jsonRes['type'];
    uid = jsonRes['uid'];
    username = jsonRes['username'];
    video = jsonRes['video'];
  }

  @override
  String toString() {
    return '{"gif": ${gif != null ? '${json.encode(gif)}' : 'null'},"image": ${image != null ? '${json.encode(image)}' : 'null'},"top_commentsVoiceuri": ${top_commentsVoiceuri != null ? '${json.encode(top_commentsVoiceuri)}' : 'null'},"comment": $comment,"down": $down,"forward": $forward,"soureid": $soureid,"up": $up,"header": ${header != null ? '${json.encode(header)}' : 'null'},"passtime": ${passtime != null ? '${json.encode(passtime)}' : 'null'},"text": ${text != null ? '${json.encode(text)}' : 'null'},"thumbnail": ${thumbnail != null ? '${json.encode(thumbnail)}' : 'null'},"top_commentsContent": ${top_commentsContent != null ? '${json.encode(top_commentsContent)}' : 'null'},"top_commentsHeader": ${top_commentsHeader != null ? '${json.encode(top_commentsHeader)}' : 'null'},"top_commentsName": ${top_commentsName != null ? '${json.encode(top_commentsName)}' : 'null'},"type": ${type != null ? '${json.encode(type)}' : 'null'},"uid": ${uid != null ? '${json.encode(uid)}' : 'null'},"username": ${username != null ? '${json.encode(username)}' : 'null'},"video": ${video != null ? '${json.encode(video)}' : 'null'}}';
  }
}
